package com.ryskoo.cms.notice.service;

import com.ryskoo.cms.notice.domain.NoticePO;
import com.ryskoo.cms.notice.repository.INoticeRepository;
import com.ryskoo.framework.core.service.BasicServiceImpl;
import com.ryskoo.framework.core.utils.DateFormatHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

/**
 * @author renyuting
 * @data 2018-05-03
 */
@Service
public class NoticeServiceImpl extends BasicServiceImpl<NoticePO> implements INoticeService{

    @Autowired
    private INoticeRepository noticeRepository;

    @PostConstruct
    public void init(){
        this.setDao(noticeRepository);
    }

    @Override
    public void create(NoticePO noticePO) {
        noticePO.setCreateTime(DateFormatHelper.getNowTimeStr());
        super.create(noticePO);
    }
}
